/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package gui.event.benhan;

import control.benhan.BAXoaFull_Ctrl;
import gui.benhan.BAXoa_Dialog;
import gui.event.ulti.Util;
import java.util.List;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import model.dao.benhan.BenhAnDAO;
import model.entity.BenhAn;

/**
 *
 * @author Admin
 */
public class BAXoaFull_evt {
    
    public static final void btnLietKeActionPerformed(){
//        JOptionPane.showMessageDialog(null, "Can't access DB");
        
    }
    
    public static final void btnDeleteActionPerformed(JTable table){
        BenhAn benhAn = BAXoaFull_Ctrl.selectRow(table);
        BAXoa_Dialog baXoaDlg = new BAXoa_Dialog(table, null, true);
        
        baXoaDlg.getTxtMaHoSoBenhAn().setText(""+benhAn.getBaMa());
        baXoaDlg.getTxtTenBenh().setText(benhAn.getBenh().getBenhTen());
        baXoaDlg.getjDateChooserNgayTiem3().setDate(benhAn.getBaNgayBd());
        baXoaDlg.getjDateChooserNgayTiem4().setDate(benhAn.getBaNgayKt());
        baXoaDlg.getTaGhiChu().setText(benhAn.getBaGhiChu());
        
        baXoaDlg.setLocationRelativeTo(null);
        baXoaDlg.setVisible(true);
    }
    
    public static final void btnCloseActionPerformed(JDialog dlg){
        dlg.dispose();
    }
    
//     public static final void btlHSBAFocusGained(List<JButton>listButtons, JTable table){
//         Util.enableListButtons(listButtons);
//         
//     }
    
}
